{extend name="public/world"}
{block name="style"}
<link rel="stylesheet" href="/static/style/project.css?t={$Think.config.hello.version}" media="all">
{/block}
{block name="container"}
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-header">
            <i class="layui-icon layui-icon-export" style="font-size: 16px;position: initial;line-height: 42px;margin: 0 5px 0 -5px;"></i>
            {$pro.name}
            <i class="layui-icon layui-icon-about tooltip" style="font-size: 16px;position: initial;line-height: 42px;margin: 0 0 0 5px;cursor: pointer;"  lay-text="{$pro.description}"></i>
            <span class="pro-status status{$pro.status}">{$pro.statustext}</span>

            {if isset($sonAuth['dispatch'])}
            <div class="layuiadmin-btn-group">
                {if $pro.status != 2 }
                <a href="{:url('/projects.Index/dispatch')}?id={$pro.id}&op=user" class="layui-btn layui-btn-sm layui-btn-radius j-iframe-pop" lxb-data="{width: '670px', height: '500px'}" title="人员分配">人员分配</a>
                {/if}
                {if $pro.start_at == 0 }
                <a href="{:url('/projects.Index/dispatch')}?id={$pro.id}&op=start" class="layui-btn layui-btn-sm layui-btn-radius layui-btn-normal j-iframe-pop" lxb-data="{width: '560px', height: '550px'}">启动项目</a>
                {/if}
                {if $pro.status == 1 && $user_level == 1 }
                <a href="{:url('/projects.Index/dispatch')}?id={$pro.id}&op=start" class="layui-btn layui-btn-sm layui-btn-radius layui-btn-normal j-iframe-pop" lxb-data="{width: '560px', height: '550px'}">周期调整</a>
                {/if}
            </div>
            {/if}
        </div>
        <div class="layui-card-body" style="padding: 0;">
            <div class="layui-form layui-tab layui-tab-card">
                <ul class="layui-tab-title">
                    <li class="layui-this">概况</li>
                    <li><a href="{:url('/projects.Index/show')}?id={$pro.id}&op=board">操纵台</a></li>
                </ul>
                <div class="layui-tab-content">
                    <div class="layui-tab-item layui-show">
                        <div class="project-overview-columns">
                            {volist name="pro.progress_list" id="gress"}
                            <div class="project-overview-column">
                                <strong title="任务数">{$gress.total}</strong>
                                <small>{$gress.title}</small>
                            </div>
                            {/volist}
                        </div>
                        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
                            <legend>项目描述</legend>
                        </fieldset>
                        <div class="accordion-content">
                            <div class="listing">
                                {$pro.description}
                            </div>
                        </div>
                        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                            <legend>人员信息</legend>
                        </fieldset>
                        <div class="accordion-content">
                            <div class="listing">
                                <ul>
                                    <li>项目创建者: <strong>{$account}</strong></li>
                                    <li>项目负责人: <strong>{:implode('，', $owners)}</strong></li>
                                    <li>普通成员: <strong>{:implode('，', $teams)}</strong></li>
                                    <li>项目审计: <strong>{:implode('，', $audits)}</strong></li>
                                    <li>项目启动时间：{$pro['start_at'] ? date('Y-m-d', $pro['start_at']) : '--/--'}</li>
                                    <li>预计完成时间：{$pro['end_at'] ? date('Y-m-d', $pro['end_at']) : '--/--'}</li>
                                    <li>实际交付时间：{$pro['finish_at'] ? date('Y-m-d', $pro['finish_at']) : '--/--'}</li>
                                </ul>
                            </div>
                        </div>
                        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
                            <legend>相关附件</legend>
                        </fieldset>
                        <div class="layui-upload-list">
                            {volist name="pro.images" id="img"}
                            <div class="layui-upload-list-son">
                                <img src="{$img}" class="layui-upload-img" layadmin-event="avartatPreview">
                            </div>
                            {/volist}
                        </div>
                        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
                            <legend>最新动态</legend>
                        </fieldset>
                        <ul class="layui-timeline">
                            {volist name="events" id="event"}
                            <li class="layui-timeline-item">
                                <i class="layui-icon layui-timeline-axis">&#xe68d;</i>
                                <div class="layui-timeline-content layui-text">
                                    <div class="layui-timeline-title">
                                        {switch $event.event_name }
                                        {case create }{$event.user_name} 创建了任务 #{$event.data.zid} {/case}
                                        {case update }{$event.user_name} 修改了任务 #{$event.data.zid} {/case}
                                        {case move_swimlane }{$event.user_name} 将任务 #{$event.data.zid} 从 "{$event.data.swimlane_name}" 移动到泳道 "{$event.data.new_swimlane_name}" 下 {/case}
                                        {case move_column }{$event.user_name} 将任务 #{$event.data.zid} 从 "{$event.data.src_column_name}" 移动到栏目 "{$event.data.dst_column_name}" 下 {/case}
                                        {case move_position }{$event.user_name} 将任务 #{$event.data.zid} 从 "{$event.data.src_column_name}" 移动到栏目 "{$event.data.dst_column_name}" 的 #{$event.data.position} 位置 {/case}
                                        {/switch}
                                        <small class="activity-date">{$event.create_at}</small>
                                    </div>
                                    <ul>
                                        <li>{$event.data.title}</li>
                                    </ul>
                                </div>
                            </li>
                            {/volist}
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script>
    layui.use(['form'], function() {
        var $ = layui.jquery
            , form = layui.form;
        var refreshDom = true;
        $("#App_tabsheader>li", parent.document).click(function(){
            if( typeof(refreshDom) != 'undefined' && refreshDom ) {
                window.location.reload();
            }
        });
        $('.tooltip').on('mouseover', function() {
            var that = this;
            layer.tips($(that).attr('lay-text'), that, {
                time : 0,
                tips : [2, '#5a5a5a']
            });
        }).on('mouseout', function() {
            layer.closeAll('tips');
        });
    });
</script>
{/block}